package znbkListXtfx.api;

import android.util.Log;

import com.example.lancooznbk.service.HttpGetServer;
import com.lancoo.rxretrofitlibrary.Api.BaseApi;
import com.lancoo.rxretrofitlibrary.Api.UserInfo;
import com.lancoo.rxretrofitlibrary.listener.HttpOnNextListener;
import com.trello.rxlifecycle.components.support.RxFragment;

import retrofit2.Retrofit;
import rx.Observable;

/**
 * Created by Administrator on 2018\1\29 0029.
 */

public class SystemReviewListApi extends BaseApi{


    private String paperForm = "1";//系统复习
    private int answerState = -1;
    private int pageIndex = 1;
    private int pageSize = 10;

    public String getPaperForm() {
        return paperForm;
    }

    public void setPaperForm(String paperForm) {
        this.paperForm = paperForm;
    }

    public int getAnswerState() {
        return answerState;
    }

    public void setAnswerState(int answerState) {
        this.answerState = answerState;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }


    /**
     * PageIndex : 1
     * PageSize : 1
     * TotalCount : 4
     * ModelPaperInfoList : [{"PaperID":"P20181241656334680","PaperName":"高中英语系统复习试卷1","StuID":"zxstu8","StuName":"朱小玲","SubjectID":"C","StageNo":"C","Detail":[{"Index":1,"QuesID":"CCAE06057DHE10E00EW","Score":1},{"Index":2,"QuesID":"CCAE07060DHE10C00D7","Score":1},{"Index":3,"QuesID":"CCAE17077DHE10800BZ","Score":1},{"Index":4,"QuesID":"CCAE06057DHE10C00E4","Score":1},{"Index":5,"QuesID":"CCAE06049DHE10200Ap","Score":1},{"Index":6,"QuesID":"CCAE06057DHE10E00W7","Score":1},{"Index":7,"QuesID":"CCAE06057DHE10Q00Z0","Score":1},{"Index":8,"QuesID":"CCAE07058DHE10V00bp","Score":1},{"Index":9,"QuesID":"CCAE06057DHE10Y00bd","Score":1},{"Index":10,"QuesID":"CCAE18143DHE10Z00ai","Score":1},{"Index":11,"QuesID":"CCAE08070DHm10z00gI","Score":1},{"Index":12,"QuesID":"CCAE07065DHm10z00Zk","Score":1},{"Index":13,"QuesID":"CCAE17077DHC10z02F7","Score":1},{"Index":14,"QuesID":"CCAE11080DHD10z02jC","Score":1},{"Index":15,"QuesID":"CCAE07074DHD10z01vK","Score":1},{"Index":16,"QuesID":"CCAE14111DHD10z00h6","Score":1},{"Index":17,"QuesID":"CCAE07073DHD10z00ti","Score":1},{"Index":18,"QuesID":"CCAE08070DHD10z00tc","Score":1},{"Index":19,"QuesID":"CCAE06055DHD10z01bM","Score":1},{"Index":20,"QuesID":"CCAE19163DHU10l00Jf","Score":1},{"Index":21,"QuesID":"CCAE17077DHf10G00O4","Score":1}],"TotalItemCount":21,"AnsweredItemCount":0,"AnswerState":0,"Duration":0,"CreateTime":"2018-01-24T16:56:33","UpdateTime":"2018-01-24T16:56:33","PaperContainKlg":null}]
     */

    public SystemReviewListApi(HttpOnNextListener listener, RxFragment rxFragment) {
        super(listener, rxFragment);
    }



    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpGetServer httpGetServer = retrofit.create(HttpGetServer.class);
        Log.e("==UserInfo.StuId===",UserInfo.StuId);
        Log.e("==UserInfo.StuId===",UserInfo.SubjectId);
        Log.e("==UserInfo.StuId===",UserInfo.StageNo);
        Log.e("==UserInfo.StuId===",paperForm);
        Log.e("==UserInfo.StuId===","answerState==="+answerState);
        Log.e("==UserInfo.StuId===","pageIndex==="+pageIndex);
        Log.e("==UserInfo.StuId===","pageSize===="+pageSize);
        return httpGetServer.getSystemReviewListEntity(UserInfo.StuId,
                UserInfo.SubjectId, UserInfo.StageNo,paperForm,answerState,pageIndex,pageSize);

    }

}
